# Contributor: Katie Holly <holly@fuslvz.ws>
# Maintainer: Katie Holly <holly@fuslvz.ws>
pkgname=lyrebird
pkgver=0.2.0
pkgrel=2
pkgdesc="pluggable transport proxy for Tor, implementing obfs4"
url="https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird"
arch="all"
license="BSD-3-Clause"
makedepends="go"
source="$pkgname-$pkgver.tar.bz2::https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird/-/archive/lyrebird-$pkgver/lyrebird-lyrebird-$pkgver.tar.bz2"
builddir="$srcdir/lyrebird-lyrebird-$pkgver"

# it used to be named this upstream
provides="obfs4proxy=$pkgver-r$pkgrel"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o lyrebird ./cmd/lyrebird
}

check() {
	go test -short ./...
}

package() {
	install -Dm755 lyrebird -t "$pkgdir"/usr/bin/
}

sha512sums="
66e026c1c19d418f57ab3d5550257614056f24035bd991dddb4eb71bb9000d17abcd22aeb9d36cd52e3f1c7e9a2acdafdf71e05b1bf0c91d64c2d881d08fa66b  lyrebird-0.2.0.tar.bz2
"
